package routers

import (
	olUtilManage "github.com/PhlexTheCharr/gofurry-cloud-service/apps/openlist/manage/util/controller"
	olUtil "github.com/PhlexTheCharr/gofurry-cloud-service/apps/openlist/util/controller"
	"github.com/PhlexTheCharr/gofurry-cloud-service/middleware"
	"github.com/gofiber/fiber/v2"
)

/*
 * @Desc: 接口层
 * @author: 慵狼小洛
 * @version: v1.0.0
 */

func OpenlistUtilApi(g fiber.Router) {
	g.Get("/getLogo", olUtil.UtilApi.GetLogo)   // 为 OpenList 提供自定义 logo
	g.Get("/getImage", olUtil.UtilApi.GetImage) // 为 OpenList 提供背景随机图片

	g.Get("/getSaying", olUtil.UtilApi.GetSaying) // 为 OpenList 提供随机金句

	// 鉴权
	g.Use(middleware.ApiTokenMiddleware())
	{
		// 管理部分
		g.Post("/manage/saying/add", olUtilManage.UtilManageApi.AddSaying)       // 新增金句
		g.Post("/manage/saying/delete", olUtilManage.UtilManageApi.DeleteSaying) // 删除金句
		g.Post("/manage/saying/update", olUtilManage.UtilManageApi.UpdateSaying) // 修改金句
		g.Post("/manage/saying/page", olUtilManage.UtilManageApi.SayingPage)     // 分页查询金句
	}

}
